package com.serkol.utils;

import com.serkol.constant.AuthConstant;
import org.apache.commons.lang3.StringUtils;

public class LangValidUtils {

    public static boolean getValid(String str) {
        boolean valid = false;
        String myLanguage = AuthConstant.getLanguage();
        String s = myLanguage.toUpperCase();
        String s1 = str.toUpperCase();
        if (s.indexOf(s1) > -1) {
            valid = true;
        }
        return valid;
    }

    public static boolean getValid(String myLanguage,String str) {
        boolean valid = false;
if(StringUtils.isNotEmpty(myLanguage) && StringUtils.isNotEmpty(str)) {
    String s = myLanguage.toUpperCase();
    String s1 = str.toUpperCase();
    if (s.indexOf(s1) > -1) {
        valid = true;
    }
}
        return valid;
    }

    public static String getValid(String str, String str1, String str2) {
        String myLanguage = AuthConstant.getLanguage();
        String s = myLanguage.toUpperCase();
        String s1 = str.toUpperCase();
        if (s.indexOf(s1) > -1) {
            return str1;
        } else {
            return str2;
        }

    }
}
